package com.example.list;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

public class ShapeOutActivity extends AppCompatActivity implements View.OnClickListener {
    private TextView tvIn;
    private TextView tvOut;
    private LinearLayout ll_in;
    private LinearLayout ll_out;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shape_out);
        initView();
        registerListener();
        initData();
    }

    private void initData() {
        ll_in.setVisibility(View.VISIBLE);
//        ll_out.getBackground().setAlpha(0);
        ll_out.setBackgroundColor(Color.TRANSPARENT);

    }

    private void initView() {
        ll_in = (LinearLayout) findViewById(R.id.transfer_ll_in);
        ll_out = (LinearLayout) findViewById(R.id.transfer_ll_out);

    }
    private void registerListener() {

        ll_in.setOnClickListener(this);
        ll_out.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.transfer_ll_in:
                ll_in.setVisibility(View.VISIBLE);
//                tvOut.setVisibility(View.INVISIBLE);
                ll_out.getBackground().setAlpha(0);
                ll_in.setBackground(getDrawable(R.drawable.shape_bg_white_without_bottom_5));
                break;
            case R.id.transfer_ll_out:
//                tvIn.setVisibility(View.INVISIBLE);
                ll_in.getBackground().setAlpha(0);
                ll_out.setVisibility(View.VISIBLE);
                ll_out.setBackground(getDrawable(R.drawable.shape_bg_white_without_bottom_5));
                break;
        }
    }
}